package com.terry.bootdemo.web.controller;

import com.terry.bootdemo.web.annotation.SameUrlData;
import com.terry.bootdemo.web.annotation.TokenAnnotation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping(value = "test")
public class TestLoginController {
    @TokenAnnotation(save=true)
    @RequestMapping(value = "/test")
    public String hello(HttpServletRequest request) {
        request.setAttribute("hello", "涛tao");
        System.out.println("hahahahah");
        return "testLogin";
    }
    @TokenAnnotation(remove=true)
    @SameUrlData
    @RequestMapping(value = "/testLogin")
    public String login1(){
        System.out.println(1111);
        return "home";
    }
    /*@TokenAnnotation(remove = true)
    @RequestMapping(value = "checkLoginToken",method = RequestMethod.POST)
    public String checkLoginToken(){
        System.out.println(222);
        return "redirect:/testLogin";
    }*/
}
